package 蓝桥真题;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class 分巧克力 {
       static BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
       final static int N=100010;
       static int n,k;
       static class Pair{
    	      int h,w;
    	      Pair(int h,int w){
    	    	  this.h=h;
    	    	  this.w=w;
    	      }
       }
      static Pair cs[]=new Pair[N];
      
      static int check(int x){
    	     int res=0;
    	     for(int i=0;i<n;i++){
    	    	 res+=((cs[i].h/x)*(cs[i].w/x));
    	     }
    	     return res;
      }
      public static void main(String[] args) throws IOException {
		     String[]ss=br.readLine().split(" ");
		     n=Integer.parseInt(ss[0]);k=Integer.parseInt(ss[1]);
		     int max=-0x3f3f3f3f;
		     for(int i=0;i<n;i++){
		    	 ss=br.readLine().split(" ");
		    	 int h=Integer.parseInt(ss[0]),w=Integer.parseInt(ss[1]);
		    	 max=Math.max(max,Math.max(h,w));
		    	 cs[i]=new Pair(h,w);
		     }
		     int l=1,r=max;
		     while(l<r){
		    	  int mid=l+r+1>>1;
		          if(check(mid)>=k)l=mid;
		          else r=mid-1;
		     }
		     System.out.print(l);
		     
	}
}
